TurboForth Data Sheet - MARKER                                     8th June 2011
                   __  __          _____  _  ________ _____  
                  |  \/  |   /\   |  __ \| |/ /  ____|  __ \ 
                  | \  / |  /  \  | |__) | ' /| |__  | |__) |
                  | |\/| | / /\ \ |  _  /|  < |  __| |  _  / 
                  | |  | |/ ____ \| | \ \| . \| |____| | \ \ 
                  |_|  |_/_/    \_\_|  \_\_|\_\______|_|  \_\
                                                             

Seasoned Forth veterans will know of MARKER. Those of you that don't will find 
it very handy.

MARKER works a little bit like FORGET, but you can use MARKER in blocks to mark 
a section of code that is to be removed.

Firstly, the definition of MARKER:

: MARKER LATEST @ CREATE , DOES> @ LATEST ! ;

Now, say you are working on some code, and have 75% of your definitions working
and tested:

: def1 ... ... ... ... ;
: def2 ... ... ... ... ;
: def3 ... ... ... ... ;
: def4 ... ... ... ... ;

You now want to start work on def5 def6 and def7. This will mean repeatedly 
removing them from memory with FORGET, or using COLD and reloading the entire 
application from the beginning. This can get tedious with a large application, 
especially if you are working from floppy disk.

With MARKER, you can create a marker at the point at which you want to erase 
the dictionary entries, like this:

: def1 ... ... ... ... ;
: def2 ... ... ... ... ;
: def3 ... ... ... ... ;
: def4 ... ... ... ... ;
MARKER WORK-POINT
: def5 ... ... ... ... ;
: def6 ... ... ... ... ;
: def7 ... ... ... ... ;

This creates a word called WORK-POINT that, when executed, erases all the words
in the dictionary immediately following it. So, if you did this:

: def1 ... ... ... ... ;
: def2 ... ... ... ... ;
: def3 ... ... ... ... ;
: def4 ... ... ... ... ;
MARKER WORK-POINT
: def5 ... ... ... ... ;
: def6 ... ... ... ... ;
: def7 ... ... ... ... ;
WORK-POINT

Then def5, def6 and def7 will be removed from the dictionary, but def1, def2, 
def3, and def4 will still remain. You can then repeatedly re-define your words,
leaving the words that you have already written and de-bugged in memory.
